package com.nokia.example.imagescaler;

import javax.microedition.lcdui.Image;

import org.tantalum.util.ImageUtils;

public final class TantalumScaler extends ImageScaler {
	private static final String[] TANTALUM_SCALING_ALGORITHM_NAME = {"BASIC_ONE_POINT_PICK", "ONE_POINT_PICK", "FIVE_POINT_BLEND", "WEIGHTED_AVERAGE_OPAQUE", "WEIGHTED_AVERAGE_TRANSLUCENT"};
	final int scalingAlgorithm;
	
	public TantalumScaler(final int scalingAlgorithm) {
		this.scalingAlgorithm = scalingAlgorithm;
	}

	public Image scale(final int newWidth, final int newHeight, final Image originalImage) {
		return ImageUtils.scaleImage(originalImage, newWidth, newHeight, scalingAlgorithm);
	}

	public String type() {
		return "Tantalum: scalingAlgorithm=" + TANTALUM_SCALING_ALGORITHM_NAME[scalingAlgorithm];
	}
}
